@svizzle/utils/[any-any]-[any-boolean]

Methods

(static) isArrayWith(accessor) → {function}

Source:
Since:
  • 0.5.0

Return a function returning true if the accessed value is an array

Example
> isArrayWith(getValue)({key: 'a', value: [1, 2]})
true
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function

(static) isNilWith(accessor) → {function}

Source:
Since:
  • 0.5.0

Return a function returning true if the accessed value is null of undefined

Example
> isNilWith(getValue)({key: 'a', value: null})
true
> isNilWith(getValue)({key: 'a'})
true
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function

(static) isNotNaNWith(accessor) → {function}

Source:
Since:
  • 0.5.0

Return a function returning true if the accessed value is not NaN

Example
> isNotNaNWith(getValue)({key: 'a', value: 1})
true
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function

(static) isNotNilWith(accessor) → {function}

Source:
Since:
  • 0.5.0

Return a function returning true if the accessed value is not null of undefined

Example
> isNotNilWith(getValue)({key: 'a', value: 1})
true
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function

(static) isNotNullWith(accessor) → {function}

Source:
Since:
  • 0.5.0

Return a function returning true if the accessed value is not null

Example
> isNotNullWith(getValue)({key: 'a', value: 1})
true
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function

(static) isNullWith(accessor) → {function}

Source:
Since:
  • 0.5.0

Return a function returning true if the accessed value is null

Example
> isNullWith(getValue)({key: 'a', value: null})
true
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function

(static) isNumberWith(accessor) → {function}

Source:
Since:
  • 0.5.0

Return a function returning true if the accessed value is a number

Example
> isNumberWith(getValue)({key: 'a', value: 1})
true
> isNumberWith(getValue)({key: 'a', value: 'a'})
false
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function

(static) isObjectWith(accessor) → {function}

Source:
Since:
  • 0.5.0
See:

Return a function returning true if the accessed value is an object

Example
> isObjectWith(getValue)({key: 'a', value: {a: 1}})
true
> isObjectWith(getValue)({key: 'a', value: 'a'})
false
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function

(static) isStringWith(accessor) → {function}

Source:
Since:
  • 0.5.0

Return a function returning true if the accessed value is a string

Example
> isStringWith(getValue)({key: 'a', value: 'a'})
false
> isStringWith(getValue)({key: 'a', value: 1})
false
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function

(static) isToFloatValidNumberWith(accessor) → {function}

Source:
Since:
  • 0.5.0
See:
  • isToFloatValidNumberWith

Return a function returning true if the accessed value can be turned into a valid number

Example
> isToFloatValidNumberWith(getValue)({key: 'a', value: [1]})
true
> isToFloatValidNumberWith(getValue)({key: 'a', value: []})
false
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function

(static) isToNumberValidNumberWith(accessor) → {function}

Source:
Since:
  • 0.5.0
See:

Return a function returning true if the accessed value can be turned into a valid number

Example
> isToNumberValidNumberWith(getValue)({key: 'a', value: '123'})
true
> isToNumberValidNumberWith(getValue)({key: 'a', value: '123px'})
false
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function

(static) isUndefinedWith(accessor) → {function}

Source:
Since:
  • 0.5.0

Return a function returning true if the accessed value is undefined

Example
> isUndefinedWith(getValue)({key: 'a', value: 'a'})
false
> isUndefinedWith(getValue)({key: 'a', value: 1})
false
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function

(static) isValidNumberWith(accessor) → {function}

Source:
Since:
  • 0.5.0
See:

Return a function returning true if the accessed value is a valid number

Example
> isValidNumberWith(getValue)({key: 'a', value: 'a'})
false
> isValidNumberWith(getValue)({key: 'a', value: 1})
false
Parameters:
Name Type Description
accessor function
Returns:
  • Any -> Boolean
Type
function